package com.frxuexi.sign

import androidx.lifecycle.MutableLiveData
import com.frxuexi.lib_base.entity.SignBean
import com.frxuexi.lib_base.entity.SignBeanItem
import com.frxuexi.lib_base.mvvm.BaseViewModel
import com.frxuexi.lib_base.net.ApiService
import com.frxuexi.lib_base.net.VideoApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SignViewModel @Inject constructor(val apiService: ApiService):BaseViewModel() {
    val signData = MutableLiveData<SignBeanItem>()

    val signListData = MutableLiveData<SignBean>()

    fun sign(item:SignBeanItem){
        httpRequest({apiService.sign(toBody(item))},signData::postValue)
    }

    fun getSigns(uid:Int){
        httpRequest({apiService.getSigns(uid)},signListData::postValue)
    }
}